package top.fengleifeng.question;

import java.util.LinkedList;
import java.util.List;

/**
 * @author : fengleifeng
 * @Package top.fengleifeng.question
 * @Description:
 * @date Date : 2021年02月23日 8:43 下午
 */
public class Num130被围绕的区域 {

    class Solution {

        public void solve(char[][] board) {
            boolean check[][] = new boolean[board.length][board[0].length];
            for (int i = 0; i < board.length; i++) {
                for (int j = 0; j < board[i].length; j++) {
                    if (board[i][j] == 'O' ) {
                        check[i][j] = true;
                        List<int[]> list = new LinkedList<>();
                        list.add(new int[]{i, j});
                        check(board, check, list, i, j);
                    }else{
                        check[i][j] = true;
                    }
                }
            }
        }

        private void check(char[][] board, boolean[][] check, List<int[]> list, int i, int j) {
            //深度遍历


            if (i - 1 <= 0 || i + 1 >= board.length || j - 1 <= 0 || j + 1 >= board[i].length) {

            }
        }
        private void deep(char[][] board, boolean[][] check, List<int[]> list,int i, int j){
            if(i+1<board.length && board[i+1][j]=='O' && !check[i+1][j]){
                check[i+1][j] = true;
                list.add(new int[]{i+1,j});
            }
            if(j+1<board[i].length && board[i][j+1]=='O' && !check[i][j+1]){
                check[i+1][j] = true;
                list.add(new int[]{i+1,j});
            }
        }
    }
}
